package fl.ass.service.service;

import cmm.service.core.framework.biz.IBaseBiz;
import cn.cmm.base.framework.exception.BaseException;
import fl.ass.facade.condition.AssDealRedeemQueryCondition;
import fl.ass.facade.dto.AssDealRedeemDTO;
import fl.ass.service.po.AssDealRedeem;

import java.util.Date;
import java.util.Map;

/**
 * @Description: 处置赎回表 服务层接口
 * @Description:持久层方法名称前缀：新增：insert* 删除：delete* 修改：update* 批量：batch* 查询对象：select* get* find* 查询集合：select*
 * @Description:业务层方法名称前缀：新增：add* 删除：remove* 修改：modify* 查询对象：select* get* 批量：batch* 查询集合：search*
 */
public interface IAssDealRedeemService extends IBaseBiz<AssDealRedeem, AssDealRedeemDTO, AssDealRedeemQueryCondition>{

    /**
     * 查询拖车赎回数据
     * @param id
     * @return
     */
    public AssDealRedeemDTO selectByRedeemId(Long id) throws BaseException;

    /**
     * 计算结清对客IRR和结清优惠金额1
     * @param paySchId 支付表id
     * @param stlAmt 赎回结清金额
     * @return
     * @throws BaseException
     */
    public Map<String, Double> getCalcStlCstIRRAndDiscount(Long paySchId, Long stlAmt, Date stlStDt) throws BaseException;

    /**
     * 获得的irr和费用项插入数据库
     * @param redeemId 赎回表id
     * @param paySchId 支付表id
     * @param stlCstIrr 结清对客irr
     * @param discountAmt 结清优惠金额1
     * @return
     * @throws BaseException
     */
    public boolean saveStlCstIrrAndDiscountAmt(Long redeemId, Long paySchId, Double stlCstIrr, Double discountAmt, Long usrId) throws BaseException;

    /**
     * 赎回流程不通过删除结清优惠金额1
     * @param paySchId
     * @return
     * @throws BaseException
     */
    public boolean removeStlDiscountAmt1ByPaySchId(Long paySchId) throws BaseException;

    Long addWithId(AssDealRedeemDTO dto) throws BaseException;

}
